﻿
using EU.Core.Common;
using MongoDB.Driver;

namespace EU.Core.Repository.MongoRepository;


public class MongoDbContext
{
    private readonly IMongoDatabase _database = null;

    public MongoDbContext()
    {
        var client = new MongoClient(AppSettings.app(new string[] { "Mongo", "ConnectionString" }));
        _database = client.GetDatabase(AppSettings.app(new string[] { "Mongo", "Database" }));
    }

    public IMongoDatabase Db
    {
        get { return _database; }
    }

    //public IMongoCollection<TEntity> Query
    //{
    //    get
    //    {
    //        return _database.GetCollection<TEntity>(nameof(TEntity));
    //    }
    //}
}
